const router = require('koa-router')()

var service = require('../service.js')

router.get('/fileSync/project/fileList/:projectName', async (ctx, next) => {
	var projectName = ctx.params.projectName
	var fileList = service.projectFileList(projectName)
	ctx.body = fileList
})
router.get('/fileSync/project/file/:filePath*', async (ctx, next) => {
	var filePath = ctx.params.filePath
	var fileContent = await service.readFile(filePath)
	ctx.body = fileContent
})

module.exports = router
